﻿using System;
using System.Collections;
using System.Data;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using Skyworth.CRM.Service.Entity;
using Skyworth.CRM.Common;
using Skyworth.CRM.Service.IDAL;
using Skyworth.CRM.Service.IBLL;

namespace Skyworth.CRM.BLL
{
    public class EmployeeBLL : IEmployeeBLL
    {
        private IEmployeeDAL _employeeDAL;

        public EmployeeBLL(IEmployeeDAL employeeDAL)
        {
            _employeeDAL = employeeDAL;
        }
        public DataTable Query(string strWhere)
        {
            return _employeeDAL.Query(strWhere);
        }

        public DataTable GetEmployeesByPage(string strWhere, string strOrderBy, int pageIndex, int pageSize, out int recordCount, out int pageCount)
        {
            return _employeeDAL.GetEmployeesByPage(strWhere, strOrderBy, pageIndex, pageSize,out recordCount,out pageCount);
        }

        public void DeleteEmployee(int employeeId)
        {
            _employeeDAL.DeleteEmployee(employeeId);
        }

        public Employee GetEmployeeById(int employeeId)
        {
            return _employeeDAL.GetEmployeeById(employeeId);
        }

        public void Add(Employee employee)
        {
            _employeeDAL.Add(employee);
        }

        public void Update(Employee employee)
        {
           _employeeDAL.Update(employee);
        }
    }
}
